﻿// controller for search by color
angular.module('app.search').controller('SearchResultsByColorsController', ['$scope', '$state', 'searchService',
	function ($scope, $state, searchService) {
	    'use strict';

		var instance = this;
		// handle response for get by by color
		this.handleGetImagesResponse = function (response) {
			$scope.handleGetImagesResponse(response);
		};
		// call the search search to search by colors from the query string
	    searchService.byColors($state.params.colors).then($scope.handleGetImagesResponse);
	}]);